import http from '../common/axios.js'

// 账号密码登录
function login(data) {
	let url = '/user/login'
	return http.post(url, data)
}
// 获取短信验证码
function send(data) {
	let url = '/sms/send'
	return http.post(url, data)
}
// 手机验证码登录
function mobilelogin(data) {
	let url = '/user/mobilelogin'
	return http.post(url, data)
}
// 注册
function register(data) {
	let url = '/user/register'
	return http.post(url, data)
}
// 完善用户信息
function updateUser(data) {
	let url = '/v2/user/updateUser'
	return http.post(url, data)
}
// 图片上传
function upload(data) {
	let url = 'common/upload'
	return http.post(url, data)
}
// 网站配置项
function getWebConfig() {
	let url = '/v2/config/getWebConfig'
	return http.post(url)
}
// 获取用户个人信息
function getUserDetails(data) {
	let url = '/v2/user/getUserDetails'
	return http.get(url,data)
}
// 获取积分列表
function getScoreList(data) {
	let url = '/v2/user/getScoreList'
	return http.get(url,data)
}
// 获取我的帖子列表
function getMyPlazaPostList(data) {
	let url = '/v2/user/getMyPlazaPostList'
	return http.get(url,data)
}
// 获取收藏列表
function getMyFavorite(data) {
	let url = '/v2/user/getMyFavorite'
	return http.get(url,data)
}
// 获取评论列表
function getMyCommentedArticles(data) {
	let url = '/v2/user/getMyCommentedArticles'
	return http.post(url,data)
}
//获取openid
function getWechatOpenid(data) {
	let url = '/user/getWechatOpenid'
	return http.post(url,data)
}
//支付
function wechatMiniPay(data) {
	let url = '/wechat_pay/wechatMiniPay'
	return http.post(url,data)
}

export default {
	login,
	send,
	mobilelogin,
	register,
	updateUser,
	upload,
	getWebConfig,
	getUserDetails,
	getScoreList,
	getMyPlazaPostList,
	getMyFavorite,
	getMyCommentedArticles,
	getWechatOpenid,
	wechatMiniPay
}